{{extend './common/layout.html'}}

{{block 'main'}}
    <!-- 头部 -->
    {{include './common/header.html'}}
    <!-- /头部 -->
    <!-- 主体内容 -->
    <div class="content">
        <!-- 侧边栏 -->
        {{include './common/aside.html'}}
        <!-- 侧边栏 -->
        <div class="main">
            <!-- 分类标题 -->
            <div class="title">
                <h4>{{userdata && id}}</h4>
                <p class="tips">{{message}}</p>
            </div>
            <!-- /分类标题 -->
            <form class="form-container" method="post" action="{{link}}">
                <div class="form-group">
                    <label>用户名</label>
                    <input type="text" class="form-control" placeholder="请输入用户名" name="username" value="{{userdata && userdata.username}}" required>
                </div>
                <div class="form-group">
                    <label>邮箱</label>
                    <input type="email" class="form-control" placeholder="请输入邮箱地址" name="email" value="{{userdata && userdata.email}}" required>
                </div>
                <div class="form-group">
                    <label>密码</label>
                    <input type="password" class="form-control" placeholder="请输入密码" name="password" required>
                </div>
                <div class="form-group">
                    <label>角色</label>
                    <select class="form-control" name="role" required>
                        <option value="normal" {{userdata && userdata.role == 'normal'?'selected':''}}>普通用户</option>
                        <option value="admin" {{userdata && userdata.role == 'admin'?'selected':''}}>超级管理员</option>
                    </select>
                </div>
                <div class="form-group">
                    <label>状态</label>
                    <select class="form-control" name="state" required>
                        <option value="0" {{userdata && userdata.state == 0?'selected':''}}>启用</option>
                        <option value="1" {{userdata && userdata.state == 1?'selected':''}}>禁用</option>
                    </select>
                </div>
                <div class="buttons">
                    <input type="submit" class="btn btn-primary" value="{{button}}">
                </div>
            </form>
        </div>
    </div>
    <!-- /主体内容 -->
{{/block}}